package com.thoughtworks;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class MemoryRepository implements Repository<Student> {
   HashMap<String, Student> students = new HashMap<>();

    @Override
    public void save(String id, Student student) {
        students.put(id, student);
    }

    @Override
    public Student get(String id) {
        return students.get(id);
    }

    @Override
    public void delete(String id) {
        students.remove(id);
    }

    @Override
    public void update(String id, Student student) {
        students.put(id, student);
    }

    @Override
    public void list() {
        System.out.println(students);
    }
}
